import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

/// 轻提示工具类 - 单例模式静态类写法
class ToastUtil {
  /// 显示成功轻提示（绿色）
  static void showSuccess(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM,
      backgroundColor: Colors.green,
      textColor: Colors.white,
      webPosition: 'center',
      webBgColor: '#67ad5b',
    );
  }

  /// 显示错误轻提示（红色）
  static void showError(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM,
      backgroundColor: Colors.red,
      textColor: Colors.white,
      webPosition: 'center',
      webBgColor: '#e15241',
    );
  }

  /// 显示常规轻提示（蓝色）
  static void showInfo(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM,
      backgroundColor: Colors.blue,
      textColor: Colors.white,
      webPosition: 'center',
      webBgColor: '#628fab',
    );
  }
}
